using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._AnalysisTools._Proximity
{
    /// <summary>
    /// <para>Graphic Buffer</para>
    /// <para>Creates buffer polygons around input features to a specified distance. A number of cartographic shapes are available for buffer ends (caps) and corners (joins) when the buffer is generated around the feature.</para>
    /// <para>在输入要素周围创建指定距离的缓冲面。在要素周围生成缓冲区时，可使用多种制图形状来用于缓冲区端点（大写字母）和角（连接点）。</para>
    /// </summary>    
    [DisplayName("Graphic Buffer")]
    public class GraphicBuffer : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public GraphicBuffer()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The input point, line, or polygon features to be buffered.</para>
        /// <para>要缓冲的输入点、线或面要素。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para>The feature class containing the output buffers.</para>
        /// <para>包含输出缓冲区的要素类。</para>
        /// </param>
        /// <param name="_buffer_distance_or_field">
        /// <para>Distance [value or field]</para>
        /// <para><xdoc>
        ///   <para>The distance around the input features that will be buffered. Distances can be provided as either a value representing a linear distance or as a field from the input features that contains the distance to buffer each feature.</para>
        ///   <para>If linear units are not specified or are entered as Unknown, the linear unit of the input features' spatial reference is used.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将缓冲的输入要素周围的距离。距离既可以作为表示线性距离的值提供，也可以作为输入要素的字段提供，其中包含要缓冲每个要素的距离。</para>
        ///   <para>如果未指定线性单位或输入为未知，则使用输入要素空间参考的线性单位。</para>
        /// </xdoc></para>
        /// </param>
        public GraphicBuffer(object _in_features, object _out_feature_class, object _buffer_distance_or_field)
        {
            this._in_features = _in_features;
            this._out_feature_class = _out_feature_class;
            this._buffer_distance_or_field = _buffer_distance_or_field;
        }
        public override string ToolboxName => "Analysis Tools";

        public override string ToolName => "Graphic Buffer";

        public override string CallName => "analysis.GraphicBuffer";

        public override List<string> AcceptEnvironments => ["MDomain", "MResolution", "MTolerance", "XYDomain", "XYResolution", "XYTolerance", "ZDomain", "ZResolution", "ZTolerance", "extent", "geographicTransformations", "outputCoordinateSystem", "outputMFlag", "outputZFlag", "outputZValue", "parallelProcessingFactor", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_in_features, _out_feature_class, _buffer_distance_or_field, _line_caps.GetGPValue(), _line_joins.GetGPValue(), _miter_limit, _max_deviation];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The input point, line, or polygon features to be buffered.</para>
        /// <para>要缓冲的输入点、线或面要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para>The feature class containing the output buffers.</para>
        /// <para>包含输出缓冲区的要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Distance [value or field]</para>
        /// <para><xdoc>
        ///   <para>The distance around the input features that will be buffered. Distances can be provided as either a value representing a linear distance or as a field from the input features that contains the distance to buffer each feature.</para>
        ///   <para>If linear units are not specified or are entered as Unknown, the linear unit of the input features' spatial reference is used.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将缓冲的输入要素周围的距离。距离既可以作为表示线性距离的值提供，也可以作为输入要素的字段提供，其中包含要缓冲每个要素的距离。</para>
        ///   <para>如果未指定线性单位或输入为未知，则使用输入要素空间参考的线性单位。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Distance [value or field]")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _buffer_distance_or_field { get; set; }


        /// <summary>
        /// <para>Caps Type</para>
        /// <para><xdoc>
        ///   <para>Specifies the type of caps (ends) of the input features that will be buffered. This parameter is only supported for point and polygon features.</para>
        ///   <bulletList>
        ///     <bullet_item>Square—The output buffer will have a square cap around the end of the input segment. This is the default.</bullet_item><para/>
        ///     <bullet_item>Butt—The output buffer will have a cap perpendicular to the end of the input segment.</bullet_item><para/>
        ///     <bullet_item>Round—The output buffer will have a cap that is round at the end of the input segment.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将缓冲的输入要素的大写（端）类型。此参数仅支持点要素和面要素。</para>
        ///   <bulletList>
        ///     <bullet_item>方形—输出缓冲区在输入段的末端周围将有一个方形帽。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>对接—输出缓冲区将具有垂直于输入段末端的上限。</bullet_item><para/>
        ///     <bullet_item>圆形—输出缓冲区在输入段末尾的上限为圆形。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Caps Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _line_caps_value _line_caps { get; set; } = _line_caps_value._SQUARE;

        public enum _line_caps_value
        {
            /// <summary>
            /// <para>Square</para>
            /// <para>Square—The output buffer will have a square cap around the end of the input segment. This is the default.</para>
            /// <para>方形—输出缓冲区在输入段的末端周围将有一个方形帽。这是默认设置。</para>
            /// </summary>
            [Description("Square")]
            [GPEnumValue("SQUARE")]
            _SQUARE,

            /// <summary>
            /// <para>Butt</para>
            /// <para>Butt—The output buffer will have a cap perpendicular to the end of the input segment.</para>
            /// <para>对接—输出缓冲区将具有垂直于输入段末端的上限。</para>
            /// </summary>
            [Description("Butt")]
            [GPEnumValue("BUTT")]
            _BUTT,

            /// <summary>
            /// <para>Round</para>
            /// <para>Round—The output buffer will have a cap that is round at the end of the input segment.</para>
            /// <para>圆形—输出缓冲区在输入段末尾的上限为圆形。</para>
            /// </summary>
            [Description("Round")]
            [GPEnumValue("ROUND")]
            _ROUND,

        }

        /// <summary>
        /// <para>Join Type</para>
        /// <para><xdoc>
        ///   <para>The shape of the buffer at corners where two segments join. This parameter is only supported for line and polygon features.</para>
        ///   <bulletList>
        ///     <bullet_item>Miter—Results in an output buffer feature that is a square or sharp shape around corners. For example, a square input polygon feature will have a square buffer feature. This is the default.</bullet_item><para/>
        ///     <bullet_item>Bevel—The output buffer feature for inner corners will be squared while the outer corner will be cut perpendicular to the furthest point of the corner.</bullet_item><para/>
        ///     <bullet_item>Round—The output buffer feature for inner corners will be squared while the outer corner will be round.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>两个线段连接处的角处缓冲区的形状。此参数仅支持线和面要素。</para>
        ///   <bulletList>
        ///     <bullet_item>斜接 （Miter） - 生成输出缓冲区特征，该特征在角周围呈正方形或尖头形状。例如，正方形输入面要素将具有正方形缓冲区特征。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>斜角—内角的输出缓冲区特征将被平方化，而外角将垂直于角的最远点进行切割。</bullet_item><para/>
        ///     <bullet_item>倒圆角—内角的输出缓冲区特征为平方，而外角为倒圆角。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Join Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _line_joins_value _line_joins { get; set; } = _line_joins_value._MITER;

        public enum _line_joins_value
        {
            /// <summary>
            /// <para>Miter</para>
            /// <para>Miter—Results in an output buffer feature that is a square or sharp shape around corners. For example, a square input polygon feature will have a square buffer feature. This is the default.</para>
            /// <para>斜接 （Miter） - 生成输出缓冲区特征，该特征在角周围呈正方形或尖头形状。例如，正方形输入面要素将具有正方形缓冲区特征。这是默认设置。</para>
            /// </summary>
            [Description("Miter")]
            [GPEnumValue("MITER")]
            _MITER,

            /// <summary>
            /// <para>Bevel</para>
            /// <para>Bevel—The output buffer feature for inner corners will be squared while the outer corner will be cut perpendicular to the furthest point of the corner.</para>
            /// <para>斜角—内角的输出缓冲区特征将被平方化，而外角将垂直于角的最远点进行切割。</para>
            /// </summary>
            [Description("Bevel")]
            [GPEnumValue("BEVEL")]
            _BEVEL,

            /// <summary>
            /// <para>Round</para>
            /// <para>Round—The output buffer feature for inner corners will be squared while the outer corner will be round.</para>
            /// <para>倒圆角—内角的输出缓冲区特征为平方，而外角为倒圆角。</para>
            /// </summary>
            [Description("Round")]
            [GPEnumValue("ROUND")]
            _ROUND,

        }

        /// <summary>
        /// <para>Miter Limit</para>
        /// <para>Where line segments meet at a sharp angle and a Join Type of MITER has been specified, this parameter can be used to control how sharp corners in buffer output come to a point. In some cases, the outer angle where two lines join is quite large when using the MITER Join Type. This could cause the point of the corner to extend further than intended.</para>
        /// <para>如果线段以锐角相交，并且指定了 MITER 的连接类型，则此参数可用于控制缓冲区输出中的尖角如何到达某个点。在某些情况下，使用斜接类型时，两条线连接的外角非常大。这可能会导致拐角的点比预期的延伸得更远。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Miter Limit")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _miter_limit { get; set; } = 10;


        /// <summary>
        /// <para>Maximum Offset Deviation</para>
        /// <para><xdoc>
        ///   <para>The maximum distance the output buffer polygon boundary will deviate from the true ideal buffer boundary. The true buffer boundary is a curve, and the output polygon boundary is a densified polyline. Using this parameter, you can control how well the output polygon boundary approximates the true buffer boundary.</para>
        ///   <para>If the parameter is not set or is set to 0, the tool will identify the maximum deviation. It is recommended that you use the default value. Performance degradation in the tool or in subsequent analysis can result from using a maximum offset deviation value that is too small.</para>
        ///   <para>See the Maximum Offset Deviation parameter information in the Densify tool documentation for more details.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出缓冲区多边形边界将偏离真正理想缓冲区边界的最大距离。真正的缓冲区边界是曲线，输出多边形边界是致密多段线。使用此参数，可以控制输出面边界与真实缓冲区边界的近似程度。</para>
        ///   <para>如果未设置参数或设置为 0，则工具将识别最大偏差。建议您使用默认值。工具或后续分析中的性能下降可能是由于使用过小的最大偏移偏差值造成的。</para>
        ///   <para>有关详细信息，请参阅 Densify 工具文档中的最大偏移偏差参数信息。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum Offset Deviation")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string _max_deviation { get; set; } = "0 Unknown";


        public GraphicBuffer SetEnv(object MDomain = null, object MResolution = null, object MTolerance = null, object XYDomain = null, object XYResolution = null, object XYTolerance = null, object ZDomain = null, object ZResolution = null, object ZTolerance = null, object extent = null, object geographicTransformations = null, object outputCoordinateSystem = null, object outputMFlag = null, object outputZFlag = null, object outputZValue = null, object parallelProcessingFactor = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(MDomain: MDomain, MResolution: MResolution, MTolerance: MTolerance, XYDomain: XYDomain, XYResolution: XYResolution, XYTolerance: XYTolerance, ZDomain: ZDomain, ZResolution: ZResolution, ZTolerance: ZTolerance, extent: extent, geographicTransformations: geographicTransformations, outputCoordinateSystem: outputCoordinateSystem, outputMFlag: outputMFlag, outputZFlag: outputZFlag, outputZValue: outputZValue, parallelProcessingFactor: parallelProcessingFactor, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}